<%@page import="models.game.Game"%>
<%@page import="controllers.*"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="models.players.Player"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="refresh" content="1">
<title>Pandemic</title>
<style type="text/css">
body {
	background-image: url("Images/background.png");
	background-size: cover;
}

.pos {
	position: relative;
	top: 100px;
}

.topcorner {
	position: absolute;
	top: 10px;
	right: 10px;
}

table, td, th {
	border: 1px solid green;
}

th {
	text-align: center;
	background-color: #0090ff;
	color: white;
}

td {
	text-align: center;
}
</style>
</head>
<body>
	<a href="/Pandemic/Logout"><div class="topcorner">
			<button>Log out</button>
		</div></a>
	<div class="pos">
		<h1 align="center">Lobby</h1>
		<div class="center">
		<% if (!GameMenuController.getGameStarting()){ %>
			<table align="center">
				<tr>
					<th>Username</th>
					<th>Turn Index</th>
				</tr>
				<tr></tr>
				<%
					for (Player player : GameMenuController.getPlayers().values()) {
						out.println("<tr><td><b>" + player.getUsername() + "</b></td> "
								+ "<td><b>" + player.getTurnIndex() + "</b></td></tr>");
					}
				%>
			</table><br> <%} %>
			<%
				if (GameMenuController.getGameStarting()) {
					out.println("<br><form align = \"center\" method=\"get\" action=\"/Pandemic/SetSessionAtributes\"><input type=\"submit\" value=\"Start Game!\"></form>");
				}
			%>

		</div>
	</div>
</body>
</html>